<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- The HTML 4.01 Transitional DOCTYPE declaration-->
<!-- above set at the top of the file will set     -->
<!-- the browser's rendering engine into           -->
<!-- "Quirks Mode". Replacing this declaration     -->
<!-- with a "Standards Mode" doctype is supported, -->
<!-- but may lead to some differences in layout.   -->

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>Enregistrement</title>
    
   <link rel='stylesheet' type='text/css' href='css/common.css' />
    <script src="js/jquery-1.6.4.js"></script>
	<script src="js/jquery.validate.js"></script>
	<script>
$(document).ready(function() {

	// validate signup form on keyup and submit
	var validator = $("#signupform").validate({
		rules: {
			password: {
				required: true,
				minlength: 5
			},
			password_confirm: {
				required: true,
				minlength: 5,
				equalTo: "#password"
			},
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			password: {
				required: "Entrez un mot de passe",
				minlength: jQuery.format("Entrez au moins {0} caract&egrave;res")
			},
			password_confirm: {
				required: "Repetez le mot de passe",
				minlength: jQuery.format("Entrez au moins {0} caract&egrave;res"),
				equalTo: "Entrez le m&ecirc;me mot de passe que ci-dessus"
			},
			email: {
				required: "Veuillez entrer une adresse valide",
				minlength: jQuery.format("Entrez au moins {0} caract&egrave;res"),
				email: "Veuillez entrer une adresse valide"
			},
			terms: " "
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().last() );
		},
		// specifying a submitHandler prevents the default submit, good for the demo
		submitHandler: function(form) {
			$(form).submit();
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		},
		highlight: function(element, errorClass) {
			$(element).parent().next().find("." + errorClass).removeClass("checked");
		}
	});

});
</script>
  </head>

  <body>
    <h1>Enregistrement</h1>
	
    <form id="signupform" method="post" action="register">
    	<table>
    	<tr><td>Email </td><td><input type="text" name="email"/></td></tr>
    	<tr><td>Nom d'utilisateur </td><td><input type="text" name="username"/></td></tr>
    	<tr><td>Mot de passe </td><td><input type="password" name="password" id="password"/></td></tr>
    	<tr><td>Confirmation mot de passe </td><td><input type="password" name="password_confirm"/></td></tr>
    	</table><br/>
    	<input type="submit" value="Soumettre"/>
    </form>
  </body>
</html>
